/**
 * IPTablesTrafficSourceMBean.java 21.07.2006
 */
package org.dicr.traffic.source.impl;

/**
 * IPTables Traffic Source MBean interface
 *
 * @author <A href='http://dicr.org'>Igor A Tarasov</A>
 * @version 060721
 */
public interface IPTablesTrafficSourceMBean {

	/**
     * Return fire period
     *
     * @param seconds period in seconds for traffic firing.
     */
	public void setFirePeriod(int seconds);

	/**
     * Return fire period
     *
     * @return period in seconds of traffic firing
     */
	public int getFirePeriod();

	/**
     * Return resetOnFire flag.
     *
     * @return true if each time, after traffic get from iptables, iptables counters will reset to zero. false if
     *         traffic counters always increment. default is true (reset each time traffic is getted).
     */
	public boolean isResetOnFire();

	/**
     * Set resetOnFire flag.
     *
     * @param reset true to reset iptables counters after traffic getting. false to not reset. default true.
     */
	public void setResetOnFire(boolean reset);

	/**
     * Check if source is running
     *
     * @return if iptables task sheduled on specified period
     */
	public boolean isRunning();

	/**
     * Start iptables traffic source. Shedule iptables timer task on specified period.
     */
	public void start();

	/**
     * Stop iptables traffic source. Cansel iptables timer task.
     */
	public void stop();

	/**
     * Return skip empty flag
     *
     * @return true if empty traffic event are skippet
     */
	public boolean isSkipEmpty();

	/**
     * Set skip empty flag
     *
     * @param skip true to skip empty traffic events
     */
	public void setSkipEmpty(boolean skip);

	/**
     * Return events counter.
     *
     * @return count of traffic events fired by this traffic source
     */
	public long getEventsCounter();

	/**
     * Return produced elements count.
     *
     * @return count of traffic elements fired by this source
     */
	public long getProducedElementsCount();

	/**
     * Reset counters. Reset elements and events counters.
     */
	public void resetCounters();
}
